#ifndef SLEPOPTIONSWIDGET_H
#define SLEPOPTIONSWIDGET_H

#include <QWidget>
#include <QtGui>
#include "slepbase.h"


typedef enum{
    Method_Least_R,
    Method_nnLeast_R,
    Method_Logistic_R,
    Method_nnLogistic_R,

    Method_Least_C,
    Method_nnLeast_C,
    Method_Logistic_C,
    Method_nnLogistic_C,

    Method_glLeast_R,
    Method_glLogistic_R,
    Method_mcLeast_R,
    Method_mcLogistic_R,
    Method_mtLeast_R,
    Method_mtLogistic_R,

    Method_mcLeast_C,
    Method_mcLogistic_C,
    Method_mtLeast_C,
    Method_mtLogistic_C,
    Method_fusedLasso

}SLEP_METHOD;

class SlepOptionsWidget : public QWidget
{
    Q_OBJECT

public:
    SlepOptionsWidget();
    void createSlepOptionsWidget(SLEP_METHOD method);
    void createTerminationOptions();
    void createStartOptions();
    void createButtons();
    void createNormalizationOptions();
    void createReguarizationParameterOptions();
    void createMethodFlags();

    OPTS *opts;

signals:
    void okayed();
    void cancelled();


public slots:
    void accepted();
    void notAccepted();

    void setOPTS_tFlag(int tFlag);
    void setOPTS_rFlag(int rFlag);
    void setOPTS_nFlag(int nFlag);
    void setOPTS_maxIter(int maxIter);
    void setOPTS_tol(double tol);
    void setOPTS_init(int init);

    void setOPTS_lFlag(int lFlag);
    void setOPTS_mFlag(int mFlag);
    void setOPTS_rsL2(double rsL2);



private:
    QLabel *labelInit;
    QButtonGroup *buttonGroupInit;
    QLabel *labelMaxIter;
    QSpinBox *spinBoxMaxIter;
    QLabel *labelTolerance;
    QDoubleSpinBox *dspinBoxTolerance;
    QLabel *labelTFlag;
    QButtonGroup *buttonGroupTFlag;
    QButtonGroup *buttonGroupNorm;
    QLabel *labelNorm;
    QLabel *labelRFlag;

    QButtonGroup *buttonGroupRFlag;

    QButtonGroup *buttonGroupLFlag;
    QButtonGroup *buttonGroupMFlag;
    QLabel *labelLFlag;
    QLabel *labelMFlag;

    QGroupBox *terminationOptions;
    QGroupBox *startOptions;
    QGroupBox *groupBoxWidget;
    QGroupBox *normOptions;
    QGroupBox *regularizationOptions;
    QGroupBox *methodFlags;


    QGroupBox *x0NormOption;
    QGroupBox *c0NormOption;
    QGroupBox *X0NormOption;

    QGroupBox *muNormOption;
    QGroupBox *nuNormOption;
    QCheckBox *checkBoxMu;
    QCheckBox *checkBoxNu;

    QPushButton *buttonOk;
    QPushButton *buttonCancel;

    QTabWidget *tabWidget;
};

#endif // SLEPOPTIONSWIDGET_H
